const { defineConfig } = require('@vue/cli-service')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  devServer: {
    host: '0.0.0.0',
    port: 8080,
    client: {
      webSocketURL: 'ws://0.0.0.0:8080/ws'
    },
    headers: {
      'Access-Control-Allow-Origin': '*'
    }
  },
  configureWebpack: {
    plugins: [
      new TerserPlugin({
        cache: false,
        sourceMap: false,
        parallel: true,
        terserOptions: {
          warnings: false,
          compress: {
            pure_funcs: ['console.log']
          }
        }
      })
    ]
  }
})
